//*************************************************************************
//  PP2_11.java   Author: Tang caiming
//
//  The input represents the double precise value of the total amount of
//  money, and then determines the minimum amount of each note and coin 
//  needed to achieve the total amount of money entered.
//*************************************************************************

import java.util.Scanner;

public class PP2_11
{
   public static void main(String[] args)
   {
      final int penny,nickle,dime,quarter,dols;   // 1,5,10,25.

      int A,B,C,D,E,F,G; // ten dollar bills,five dollar bills,one dollar bills.硬币个数
     
      double amount;

      Scanner scan = new Scanner(System.in);

      penny = 1;
      nickle = 5;
      dime = 10;
      quarter = 25;
      dols = 100;

      System.out.println("please input the sum:");
      amount = scan.nextDouble();
      
      amount = amount * 1000;
      A = (int)amount / 10000;
      B = (int)(amount - A * 10000) / 5000;
      C = (int)(amount - (B * 5000 + A * 10000)) / 1000;
      D = (int)(amount - (B * 5000 + A * 10000 + C * 1000)) / 250; 
      E = (int)(amount - (B * 5000 + A * 10000 + C * 1000 + D * 250 )) / 100;
      F = (int)(amount - (B * 5000 + A * 10000 + C * 1000 + D * 250 + E * 100)) / 50;
      G = (int)(amount - (B * 5000 + A * 10000 + C * 1000 + D * 250 + E * 100 + F * 50)) / 10;





      System.out.println( A + " ten dollar bills");
      System.out.println( B + " five dollar bills");
      System.out.println( C + " one dollar bills");
      System.out.println( D + " quarters");
      System.out.println( E + " dimes");
      System.out.println( F + " nickles");
      System.out.println( G + " pennies");
   }
}   
